package com.waves.demo.config;

import com.ibeetl.starter.BeetlTemplateCustomize;
import org.beetl.core.GroupTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;

/**
 * @Package: com.waves.demo.config
 * @Author: Mr.Waves
 * @Date: 2020-04-04 16:44
 * @Description:
 **/
@Configuration
public class BeetlConf {

    @Bean
    public BeetlTemplateCustomize beetlTemplateCustomize(){
        return new BeetlTemplateCustomize(){
            public void customize(GroupTemplate groupTemplate){
                HashMap<String, Object> sharedVars = new HashMap<>();
                sharedVars.put("sharedVar", "共享变量: 全模块通用");  // 配置共享变量
                groupTemplate.setSharedVars(sharedVars);
            }
        };
    }
}
